#include"ros/ros.h"
#include"plumbing_pub_sub/Person.h"

/*


    发布方：发布人的消息
    1、包含头文件
    2、初始化ros节点
    3、创建节点句柄
    4、创建发布者对象
    5、编写发布逻辑

*/
int main(int argc, char *argv[])
{
    /* code */

    setlocale(LC_ALL,"");
    ros::init(argc,argv,"banZhuRen");

    ros::NodeHandle nh;
    ros::Publisher pub = nh.advertise<plumbing_pub_sub::Person>("liaoTian",10);

    plumbing_pub_sub::Person person;
    person.name = "zhangSan";
    person.edge = 0;
    person.height = 1.73;
    ros::Rate rate(1);

    while (ros::ok())
    {
        person.edge +=1;
        pub.publish(person);
        rate.sleep();
        ros::spinOnce();
    }
    

    return 0;
}
